#include"BinTree.h"

void PrevOrder(BTN* A)
{
	if (A == NULL)
	{
		printf("NULL ");
		return;
	}
	printf("%c ", A->data);
	PrevOrder(A->left);
	PrevOrder(A->right);
}

void InOrder(BTN* A)
{
	if (A == NULL)
	{
		printf("NULL ");
		return;
	}
	InOrder(A->left);
	printf("%c ", A->data);
	InOrder(A->right);
}

void PostOrder(BTN* A)
{
	if (A == NULL)
	{
		printf("NULL ");
		return;
	}
	PostOrder(A->left);
	PostOrder(A->right);
	printf("%c ", A->data);;
}

void TreeSize1(BTN* A, int* psize)
{
	if (A == NULL)
	{
		return;
	}
	else
	{
		++(*psize);
		TreeSize1(A->left, psize);
		TreeSize1(A->right, psize);
	}
}

int TreeSize2(BTN* A)
{
	return A == NULL ? 0 : TreeSize2(A->left) + TreeSize2(A->right) + 1;
}